#ifndef APOLLO_CONFIG_MATH_H_ 
#define APOLLO_CONFIG_MATH_H_
#include <apollo/config/base.h>

#if APOLLO_COMPILER_GNUC || APOLLO_COMPILER_HAS_BUILDIN(__builtin_clz)
    #define APOLLO_BUILDIN_CLZ(n) __builtin_clz(n)
    #define APOLLO_BUILDIN_CLZLL(n) __builtin_clzll(n)
#endif

/** 
 * @brief  
 * @note The following macro works on both 32 and 64-bit platforms.
 * Usage: instead of writing 0x1234567890123456
 * write UINT64_2PART_C(0x12345678,90123456);
 * @retval 
 */
#ifndef APOLLO_UINT64_2PART_C
    #define APOLLO_UINT64_2PART_C(a, b) (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
#endif
#endif //APOLLO_BASE_MATH_H_